const https = require("https");

// request方法也是用于获取数据，get方法只能获取get请求
// request方法可以做任意请求
https
  .request(
    {
      hostname: "www.taobao.com",
      path: "",
      port: null,
      method: "GET",
    },
    (res) => {
      let result = "";
      res.on("data", (chunk) => {
        result += chunk;
      });
      res.on("end", () => {
        console.log(result);
      });
    }
  )
  .end();
